package com.threeCountry.threadtest;

import com.testclone.User;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**
 * Created by yijy on 2017/9/20.
 */
public class MainTest {
    public static void main(String[] args) {
        User user = new User();
        ExecutorService executorService = Executors.newFixedThreadPool(3);
        User userex = new User();
        executorService.execute(new SayTest3(userex));
        while (userex.getUsername()!=null){
            System.out.println(Thread.currentThread().getName()+":"+userex.getUsername());
            break;
        }

        SayTest sayTest = new SayTest(user);
        User user1 = new User();
        SayTest1 sayTest1 = new SayTest1(user1);
        sayTest.run();
        sayTest1.run();
        while (sayTest.keep && sayTest1.keep){
            System.out.println(Thread.currentThread().getName()+":"+user.getAge()+"--"+user1.getAge());
            break;
        }
        System.out.println("end!!!");
    }

}
